package top.canyue.eca_manager.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Objects;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private int status;
    private String msg;
    private Object data;
    private String token;

    public Result(int status, String msg, Object data) {
        this.status = status;
        this.msg = msg;
        this.data = data;
    }

    @Override
    public String toString() {
        return "{" +
                "'status':" + status +
                (msg != null | Objects.equals(msg, "") ? (", 'msg':'" + msg + "'") : "") +
                (data != null | data == "" ? (", 'data':" + data) : "") +
                (token != null | Objects.equals(token, "") ? (", 'token':" + token) : "") +
                '}';
    }
}
